using System.Data;
using ET;
namespace DA
{
	public class Customer_Type_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdCustomer_Type(string keywords)
	{
	return cls.Search("sp_tb_Customer_Type_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdCustomer_TypeDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool InsertCustomer_Type(Customer_Type_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Customer_Type_Alias", data.Customer_Type_Alias);
	cls.AddParameter("@Customer_Type_Name", data.Customer_Type_Name);
	cls.AddParameter("@Customer_Type_User_Add", data.Customer_Type_User_Add);
	cls.AddParameter("@Customer_Type_Date_Add", data.Customer_Type_Date_Add);
	cls.AddParameter("@Customer_Type_Computer_Add", data.Customer_Type_Computer_Add);
	cls.AddParameter("@Customer_Type_User_Modify", data.Customer_Type_User_Modify);
	cls.AddParameter("@Customer_Type_Date_Modify", data.Customer_Type_Date_Modify);
	cls.AddParameter("@Customer_Type_Computer_Modify", data.Customer_Type_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Customer_Type_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool UpdateCustomer_Type(Customer_Type_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Customer_Type_ID", data.Customer_Type_ID);
	cls.AddParameter("@Customer_Type_Alias", data.Customer_Type_Alias);
	cls.AddParameter("@Customer_Type_Name", data.Customer_Type_Name);
	cls.AddParameter("@Customer_Type_User_Add", data.Customer_Type_User_Add);
	cls.AddParameter("@Customer_Type_Date_Add", data.Customer_Type_Date_Add);
	cls.AddParameter("@Customer_Type_Computer_Add", data.Customer_Type_Computer_Add);
	cls.AddParameter("@Customer_Type_User_Modify", data.Customer_Type_User_Modify);
	cls.AddParameter("@Customer_Type_Date_Modify", data.Customer_Type_Date_Modify);
	cls.AddParameter("@Customer_Type_Computer_Modify", data.Customer_Type_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Customer_Type_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool DeleteCustomer_Type(int id)
	{
        cls.Delete("sp_tb_Customer_Type_Delete", "@Customer_Type_ID", id);
	return true;
	}
	#endregion
	}
}